home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Information / WebSites / Wirenet / files / Dashboard2.lha / Dashboard2 / AmiTCP / bin / ShowLog < prev    next >
Text File  |  1998-03-27  |  2KB  |  62 lines

  1. /*
  2. $VER: ShowLog 2.0 (26.3.98)
  3. (c) Neil Bothwick
  4.  
  5. Adds contents of temporary logfile from Send/GetTCP to the
  6. permanent log, and displays the result lines in a requester
  7.  
  8. Adding to Information conference moved to a separate script
  9. To enable this, set "rexx/Log2Info.br" as your system enter
  10. script in Thor's System preferences.
  11. */
  12.  
  13. MainLog = 'UUSpool:Connect.log' /* Name of main logfile to copy to, leave blank if you don't want a copy */
  14. LogFile = 'UUSpool:Info.log'
  15.  
  16. /* Don't change anything below here */
  17.  
  18. options results
  19. address command
  20.  
  21. parse arg TempLog Switches
  22.  
  23. if ~exists(TempLog) then exit
  24. if symbol('MainLog') = 'VAR' & MainLog > '' then 'type' TempLog '>>'MainLog
  25. if pos('LOG',upper(switches)) > 0 then 'type' TempLog '>>'LogFile
  26.  
  27. if ~open(log,TempLog,'R') then exit
  28. drop MsgData.
  29. MsgData.TEXT.COUNT = 0
  30. body = ''
  31.  
  32. do while ~eof(log)
  33.     line = compress(readln(log),'"')
  34.     if word(line,3) ~= 'STARTUP' & word(line,3) ~= 'EXIT' then do
  35.         if body > '' & line > '' then body = body'0a'x
  36.         line = compress(substr(line,39),'0d'x)
  37.         body = body||line
  38.         MsgData.TEXT.COUNT = MsgData.TEXT.COUNT + 1
  39.         interpret 'MsgData.TEXT.'MsgData.TEXT.COUNT '= line'
  40.         end
  41.     end
  42. call close(log)
  43.  
  44. if pos('REQ',upper(switches)) > 0 then do
  45.     do while length(body) > 450
  46.         split = lastpos('0a'x, left(body,450))
  47.         interpret 'parse var body 1 reqpart' split 'dump +1 body'
  48.         call ShowReq(reqpart)
  49.         end
  50.     call ShowReq(body)
  51.     end
  52.  
  53. 'delete >NIL:' TempLog
  54.  
  55. exit
  56.  
  57. ShowReq:
  58.     parse arg str
  59.     if str > '' then call rtezrequest(str,' OK ','Status Report','rt_reqpos = reqpos_centerscr')
  60.     return 0
  61.  
  62.